package com.example.zhanghehe.myapplication

import android.content.Intent
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import android.view.View
import com.example.zhanghehe.myapplication.lessonone.LessonOneActivity
import com.example.zhanghehe.myapplication.opengl3.OpenGL3Activity
import com.example.zhanghehe.myapplication.webview.OpenGLWebViewActivity
import kotlinx.android.synthetic.main.activity_splash.*

class SplashActivity:AppCompatActivity(), View.OnClickListener {
    override fun onClick(p0: View?) {
        p0?.let {
            when(it.id){
                R.id.btnHelloOpenGl->{
                    startActivity(Intent(this@SplashActivity,MainActivity::class.java))
                }

                R.id.btnLessonOne->{
                    startActivity(Intent(this@SplashActivity, LessonOneActivity::class.java))

                }

                R.id.btnOpenGl3->{
                    startActivity(Intent(this@SplashActivity, OpenGL3Activity::class.java))

                }
                R.id.btnOpenGlWeb->{
                    startActivity(Intent(this@SplashActivity, OpenGLWebViewActivity::class.java))
                }

            }
        }
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_splash)


        btnHelloOpenGl.setOnClickListener(this)
        btnLessonOne.setOnClickListener(this)
        btnOpenGl3.setOnClickListener(this)
        btnOpenGlWeb.setOnClickListener(this)
    }
}